package com.wsc.wisdomchina.adapter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import java.util.List;

/**
 * 
 * @Description ViewPagerAdapter
 * @author jaily.zhang
 * @date 2014-7-23 下午2:07:58
 * @version V1.3.1
 */
public class ViewPagerAdapter extends PagerAdapter {
	private List<View> viewList;// viewList 集合
	private Context context;
	Button statrtbutton;// 引导页3的一个button
	Button loginbutton;// 登录button

	public ViewPagerAdapter(List<View> viewList, Context context, View view) {
		this.viewList = viewList;
		// this.view = view;
		this.context = context;
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		// TODO Auto-generated method stub
		container.removeView(viewList.get(position));
	}

	@Override
	public Object instantiateItem(ViewGroup container, int position) {
		// TODO Auto-generated method stub
		container.addView(viewList.get(position));

		return viewList.get(position);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return viewList.size();
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		// TODO Auto-generated method stub
		return arg0 == arg1;
	}

}
